{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 ArialMT;
}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs36 \cf0 NLFiltN			Non-linear Filter\
\

\fs24 NLFiltN.ar(input, a, b, d, c, l, mul, add)\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2 \cf0 Implements the filter Y\{n\} =a Y\{n-1\} + b Y\{n-2\} + d Y^2\{n-l\} + X\{n\} - c described in Dobson and sigmoid clipping.  This filter is inherently unstable, so pick some sane values and move slowly from there.
\f1 \
\

\f2 (\
\{\
	NLFiltN.ar(\
		LFSaw.ar([120, 180], 0, mul:0.1),\
		0.5, \
		-0.04,\
		0.8,\
		0.2,\
		LFCub.kr(0.2, [0, 0.5 * pi], 63, 103)\
	)\
\}.play\
)\
\
(\
\{\
	NLFiltN.ar(\
		LFSaw.ar(XLine.kr([60, 90], [360, 540], 20), 0, mul:0.1),\
		0.0, \
		0.0,\
		0.7,\
		0.4,\
		LFCub.kr(0.2, [0, 0.5 * pi], 3, 9)\
	)\
\}.play\
)\
\
( \
// internal mirroring keeps it from blowing up and makes for some gross distortion\
// this is a little loud\
\{\
	NLFiltN.ar(\
		LFPulse.ar([100, 150], mul:0.1),\
		LFNoise2.kr(1).range(0.3, 0.5), \
		0.2,\
		0.7,\
		0.4,\
		LFCub.kr(0.2, [0, 0.5 * pi], 100, 400)\
	)\
\}.play\
)\
\
(\
\{\
	NLFiltN.ar(\
		LFPulse.ar([100, 150], mul:0.1),\
		0.35, \
		-0.3,\
		0.95,\
		0.2,\
		LFCub.kr(0.2, [0, 0.5 * pi], 50, 100)\
	)\
\}.play\
)}